<template>
  <div class="Homepage">
    <h1>首页</h1>
    <el-card shadow="hover">
      <div class="jy">经营状况<img
          src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u358.png"
          alt=""></div>
      <div class="jyBox">
        <div class="d1 divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u340.png"
              alt="">
          </div>
          <div class="tie">
            <div class="tie1">
              今日参加活动人次
            </div>
            <div class="tie2">
              18
            </div>
          </div>
        </div>
        <div class="d2 divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u345.png"
              alt="">
          </div>
          <div class="tie">
            <div class="tie1">
              今日活动收入
            </div>
            <div class="tie2">
              ￥2330.00
            </div>
          </div>
        </div>
        <div class="d3 divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u340.png"
              alt="">
          </div>
          <div class="tie">
            <div class="tie1">
              今日课程订单数
            </div>
            <div class="tie2">
              18
            </div>
          </div>
        </div>
        <div class="d4 divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u345.png"
              alt="">
          </div>
          <div class="tie">
            <div class="tie1">
              今日课程订单收入
            </div>
            <div class="tie2">
              ￥2330.00
            </div>
          </div>
        </div>
      </div>
    </el-card>
    <el-card shadow="hover">
      <div class="jy">经营状况 <img
          src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u358.png"
          alt=""></div>
      <div class="jyBox">
        <div class="divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u373.png"
              alt="">
          </div>
          <div class="tie">
            <div>12</div>
            <div>待付款订单</div>
          </div>
        </div>
        <img
          src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u369.png"
          alt="">
        <div class="divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u368.png"
              alt="">
          </div>
          <div class="tie">
            <div>12</div>
            <div>待确认订单</div>
          </div>
        </div>
        <img
          src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u369.png"
          alt="">
        <div class=" divBox">
          <div class="img">
            <img
              src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u378.png"
              alt="">
          </div>
          <div class="tie">
            <div>14</div>
            <div>待回复客户</div>
          </div>
        </div>
      </div>
    </el-card>
    <el-card shadow="hover">
      <div class="jy">经营状况 <img
          src="https://cimg.axureshop.com/54/a3/eb/54a3eb5671b341c7812aa0667a94e529/images/%E9%A6%96%E9%A1%B5/u323.png"
          alt=""></div>
      <div ref="main" style="width: 100%; height: 400px">

      </div>
    </el-card>

  </div>
</template>

<script setup>
import { ElCard, ElCol } from "element-plus"
import { ref, onMounted } from "vue"
import * as echarts from 'echarts';
const main = ref() // 使用ref创建虚拟DOM引用，使用时用main.value
onMounted(
  () => {
    init()
  }
)
function init() {
  // 基于准备好的dom，初始化echarts实例
  var myChart = echarts.init(main.value);
  // 指定图表的配置项和数据
  var option = {
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['08-01', '08-02', '08-03', '08-04', '08-05', '08-06', '08-07']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: 'line',
        areaStyle: {}
      }
    ]
  };
  // 使用刚指定的配置项和数据显示图表。
  myChart.setOption(option);
}

</script>

<style lang="less" scoped>
.Homepage {
  padding: 20px 60px;

  h1 {
    height: 50px;
    color: #9137f4;

  }

  .el-card {
    margin-bottom: 12px;
    padding: 20px;
    .jy {
      display: flex;
      align-items: center;
      font-size: 14px;
      font-weight: 400;

      img {
        margin-left: 5px;
      }
    }

    .jyBox {
      // width: 100%;
      display: flex;
      justify-content: space-between;
      padding: 20px;

      .divBox {
        width: 210px;
        height: 103px;
        display: flex;

        .img {
          flex: 1;
          display: flex;
          justify-content: center;
          align-items: center;

          img {
            width: 44px;
            height: 44px;
          }
        }

        .tie {
          display: flex;
          flex-direction: column;
          justify-content: center;
          width: 134px;

          .tie1 {
            font-weight: 400;
            font-style: normal;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.898);
          }

          .tie2 {
            font-weight: 700;
            font-style: normal;
            font-size: 20px;
            color: rgb(255, 255, 255);
          }
        }
      }

      .d1 {
        background: linear-gradient(325deg, rgb(153, 0, 255) 0%, rgb(153, 0, 255) 0%, rgb(153, 153, 255) 100%, rgb(153, 153, 255) 100%);
        border: none;
        border-radius: 6px;

      }

      .d2 {
        background: linear-gradient(325deg, rgb(255, 102, 153) 0%, rgb(255, 102, 153) 0%, rgb(255, 204, 153) 100%, rgb(255, 204, 153) 100%);
        border: none;
        border-radius: 6px;
      }

      .d3 {
        background: linear-gradient(225deg, rgb(255, 204, 102) 0%, rgb(255, 204, 102) 0%, rgb(248, 216, 0) 100%, rgb(248, 216, 0) 100%);
        border: none;
        border-radius: 6px;
      }

      .d4 {
        background: linear-gradient(225deg, rgb(144, 247, 236) 0%, rgb(144, 247, 236) 0%, rgb(50, 204, 188) 100%, rgb(50, 204, 188) 100%);
        border: none;
        border-radius: 6px;
      }
    }
  }
}
</style>